package learningThread.syn.synchronizedMethodLockObj.communicate.ThreadLocal.obj;

import java.util.Date;

/**
 * 测试ThreadLocal
 * ThreadLocal是以当前线程对象作为key ,以变量作为值进行存储的
 *
 */
public class Run {

    public static ThreadLocal t11 = new ThreadLocal();

    public static void main(String[] args) {
//        if (t11.get() == null) {
//            System.out.println("从未放过值");
//            t11.set("我的值");
//        }
//        System.out.println(t11.get());
//        System.out.println(t11.get());

        try {
            ThreadA threadA = new ThreadA();
            threadA.start();
            Thread.sleep(1000);
            ThreadB threadB = new ThreadB();

            threadB.start();

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
